package net.yla.smartbus.module.controller.web.ba.file;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @author : yang lei
 * @version : 1.0
 * @date : Created in 13:19 2020/9/22
 * @description :
 */
@Controller
public class Test {

    @RequestMapping("/api/web/toa")
    public String toA() {
        return "AAA";
    }

    public static void main(String[] args) {
        String s = "The {@code String} class represents character strings. All\n" +
                " * string literals in Java programs, such as {@code \"abc\"}, are\n" +
                " * implemented as instances of this class.\n" +
                " * <p>\n" +
                " * Strings are constant; their values cannot be changed after they\n" +
                " * are created. String buffers support mutable strings.\n" +
                " * Because String objects are immutable they can be shared. For example:\n" +
                " * <blockquote><pre>\n" +
                " *     String str = \"abc\";\n" +
                " * </pre></blockquote><p>\n" +
                " * is equivalent to:\n" +
                " * <blockquote><pre>\n" +
                " *     char data[] = {'a', 'b', 'c'};\n" +
                " *     String str = new String(data);\n" +
                " * </pre></blockquote><p>\n" +
                " * Here are some more examples of how strings can be used:\n" +
                " * <blockquote><pre>\n" +
                " *     System.out.println(\"abc\");\n" +
                " *     String cde = \"cde\";\n" +
                " *     System.out.println(\"abc\" + cde);\n" +
                " *     String c = \"abc\".substring(2,3);\n" +
                " *     String d = cde.substring(1, 2);\n" +
                " * </pre></blockquote>\n" +
                " * <p>\n" +
                " * The class {@code String} includes methods for examining\n" +
                " * individual characters of the sequence, for comparing strings, for\n" +
                " * searching strings, for extracting substrings, and for creating a\n" +
                " * copy of a string with all characters translated to uppercase or to\n" +
                " * lowercase. Case mapping is based on the Unicode Standard version\n" +
                " * specified by the {@link java.lang.Character Character} class.\n" +
                " * <p>\n" +
                " * The Java language provides special support for the string\n" +
                " * concatenation operator (&nbsp;+&nbsp;), and for conversion of\n" +
                " * other objects to strings. String concatenation is implemented\n" +
                " * through the {@code StringBuilder}(or {@code StringBuffer})\n" +
                " * class and its {@code append} method.\n" +
                " * String conversions are implemented through the method\n" +
                " * {@code toString}, defined by {@code Object} and\n" +
                " * inherited by all classes in Java. For additional information on\n" +
                " * string concatenation and conversion, see Gosling, Joy, and Steele,\n" +
                " * <i>The Java Language Specification</i>.\n" +
                " *\n" +
                " * <p> Unless otherwise noted, passing a <tt>null</tt> argument to a constructor\n" +
                " * or method in this class will cause a {@link NullPointerException} to be\n" +
                " * thrown.\n" +
                " *\n" +
                " * <p>A {@code String} represents a string in the UTF-16 format\n" +
                " * in which <em>supplementary characters</em> are represented by <em>surrogate\n" +
                " * pairs</em> (see the section <a href=\"Character.html#unicode\">Unicode\n" +
                " * Character Representations</a> in the {@code Character} class for\n" +
                " * more information).\n" +
                " * Index values refer to {@code char} code units, so a supplementary\n" +
                " * character uses two positions in a {@code String}.\n" +
                " * <p>The {@code String} class provides methods for dealing with\n" +
                " * Unicode code points (i.e., characters), in addition to those for\n" +
                " * dealing with Unicode code units (i.e., {@code char} values).";

        String s1 = s.toLowerCase();
        System.out.println(s1);
        System.out.println("____________________");

        String s21 = s1.replaceAll("[^0-9]", "");
        System.out.println(s21);
        System.out.println("____________________");

        String s2 = s1.replaceAll("[0-9]", "");
        String s3 = s2.replaceAll("[\\p{P}|<|>|\\p{S}]", "");
        System.out.println("____________________");
        System.out.println(s3);

    }

}
